package com.seeyon.apps.restext;

import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
import com.seeyon.client.CTPRestClient;

public class RestEdocDemorestsample111  {

//获取公文待签收列表(Since:V61)
public static void testSigned() {
   CTPRestClient client = ClientResource.getInstance().resouresClent();
   String result = client.get("edocResource/signed?memberId=6301610059689640711", String.class);
   System.out.println(result);
}

//获取公文待登记列表(Since:V61)
public static void testRegistered() {
   CTPRestClient client = ClientResource.getInstance().resouresClent();
   String result = client.get("edocResource/registered?memberId=6301610059689640711", String.class);
   System.out.println(result);
}

//导出MHT公文单(Since:V61)
public static void testIdToMht() {
    Map res = new HashMap();
    String[] summaryId={"6930030157333809027"};
    res.put("summaryid", summaryId);
    res.put("folder", "D:\\UFSeeyon\\folder");

    CTPRestClient client = ClientResource.getInstance().resouresClent();
    String result = client.post("edoc/id/exportmht" ,res, String.class);
    System.out.println(result);
}

//导出公文花脸与正文(Since:V61)
public static void testExportEdocFile() {
   Map res = new HashMap();
   res.put("summaryid", "6930030157333809027");//edoc_summary表ID
   res.put("folder", "D:\\UFSeeyon\\folder");
   res.put("exportType", "0"); //0-全部；1-文单；2-正文(含花脸)

   CTPRestClient client = ClientResource.getInstance().resouresClent();
   String result = client.post("/edocResource/exportFile/" ,res, String.class);
   System.out.println(result);
}

//公文签收回执接口
public static void testSignedoc() {
   Map res = new HashMap();
   String edocSendId="";// edocSendId对应的是edoc_exchange_send_detail表ID
   res.put("edocSendId", edocSendId);

   Map res2 = new HashMap();
   res2.put("opinion", "签收意见:OK");//签收意见
   res2.put("receipient", "签收人姓名:V61王凯");//签收人姓名
   res2.put("signTime", "-1497600000");//long型时间
   res2.put("signUnit", "签收单位(部门)名称:测试部");//签收单位名称，如果是部门签收，则为部门名称
   res.put("edocSignReceipt", res2);

   CTPRestClient client = ClientResource.getInstance().resouresClent();
   String result = client.post("edoc/signedoc" ,res, String.class);
   System.out.println(result);
}

public static void main(String args[]){
//     testSigned();
//   testRegistered();
//    testIdToMht();
//     testExportEdocFile();
   testSignedoc();
}
}